
import './assets/index.less'

import 'animate.css/animate.min.css'
import './utils/rem'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';

import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// import 'element-plus/dist/index.css';
// import 'element-plus/theme-chalk/dark/css-vars.css'

// 此文件在vite.config.ts 中 css>preprocessorOptions 预处理器引用 
// import '@/styles/index.scss'

import * as AntdIconsVue from '@ant-design/icons-vue'
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';

import VueVirtualScroller from 'vue-virtual-scroller'

// @ts-ignore
import App from './App.vue'
import router from './router'

const app = createApp(App)

// console.log(Object.keys(ElementPlusIconsVue).filter(item => Object.keys(AntdIconsVue).includes(item)));

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

for (const [key, component] of Object.entries(AntdIconsVue)) {
    if (!app.component(key)) {
        app.component(key, component)
    } else {
        app.component('Antd' + key, component)
    }
}

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

app.use(Antd)
app.use(VueVirtualScroller)
app.use(pinia)
app.use(router)

app.mount('#app')

// console.log(import.meta.env)
